<template>
  <div class="header-actions">
    <!-- 平台选择按钮 -->
    <el-button size="large" @click="$emit('open-platform-selector')">
      平台：{{ currentPlatform.name }}
    </el-button>

    <!-- 导出 Excel -->
    <el-button
      size="large"
      type="success"
      :loading="exporting"
      @click="$emit('export')"
    >
      导出当前页
    </el-button>

    <!-- 查看数据篮 -->
    <el-button size="large" type="warning" @click="$emit('open-data-basket')">
      查看数据篮 ({{ dataBasket.length }})
    </el-button>
  </div>
</template>

<script setup>
// 只接收数据，不接收“弹窗显示状态”
defineProps({
  currentPlatform: {
    type: Object,
    required: true,
  },
  exporting: {
    type: Boolean,
    default: false,
  },
  dataBasket: {
    type: Array,
    default: () => [],
  },
});

// 定义事件
defineEmits([
  "open-platform-selector", // 打开平台选择器
  "export", // 触发导出
  "open-data-basket", // 打开数据篮对话框
]);
</script>

<style scoped>
.header-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
</style>
